/**
 * <copyright>
 * </copyright>
 *
 * $Id$
 */
package org.esmp.sysml.componentmodel.profile.rtos.impl;

import org.eclipse.emf.ecore.EClass;
import org.eclipse.emf.ecore.EObject;
import org.eclipse.emf.ecore.EPackage;
import org.eclipse.emf.ecore.impl.EFactoryImpl;
import org.eclipse.emf.ecore.plugin.EcorePlugin;
import org.esmp.sysml.componentmodel.profile.rtos.DSmodelRunnable;
import org.esmp.sysml.componentmodel.profile.rtos.EventRunnablePort;
import org.esmp.sysml.componentmodel.profile.rtos.GenericRunnable;
import org.esmp.sysml.componentmodel.profile.rtos.HardwarePort;
import org.esmp.sysml.componentmodel.profile.rtos.RTOSFactory;
import org.esmp.sysml.componentmodel.profile.rtos.RTOSPackage;
import org.esmp.sysml.componentmodel.profile.rtos.RunnablePort;

/**
 * <!-- begin-user-doc -->
 * An implementation of the model <b>Factory</b>.
 * <!-- end-user-doc -->
 * @generated
 */
public class RTOSFactoryImpl extends EFactoryImpl implements RTOSFactory {
	/**
	 * Creates the default factory implementation.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public static RTOSFactory init() {
		try {
			RTOSFactory theRTOSFactory = (RTOSFactory)EPackage.Registry.INSTANCE.getEFactory("http://www.esmp.org/SysML/ComponentModel/RTOS"); 
			if (theRTOSFactory != null) {
				return theRTOSFactory;
			}
		}
		catch (Exception exception) {
			EcorePlugin.INSTANCE.log(exception);
		}
		return new RTOSFactoryImpl();
	}

	/**
	 * Creates an instance of the factory.
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public RTOSFactoryImpl() {
		super();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	@Override
	public EObject create(EClass eClass) {
		switch (eClass.getClassifierID()) {
			case RTOSPackage.RUNNABLE_PORT: return createRunnablePort();
			case RTOSPackage.HARDWARE_PORT: return createHardwarePort();
			case RTOSPackage.DSMODEL_RUNNABLE: return createDSmodelRunnable();
			case RTOSPackage.GENERIC_RUNNABLE: return createGenericRunnable();
			case RTOSPackage.EVENT_RUNNABLE_PORT: return createEventRunnablePort();
			default:
				throw new IllegalArgumentException("The class '" + eClass.getName() + "' is not a valid classifier");
		}
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public RunnablePort createRunnablePort() {
		RunnablePortImpl runnablePort = new RunnablePortImpl();
		return runnablePort;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public HardwarePort createHardwarePort() {
		HardwarePortImpl hardwarePort = new HardwarePortImpl();
		return hardwarePort;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public DSmodelRunnable createDSmodelRunnable() {
		DSmodelRunnableImpl dSmodelRunnable = new DSmodelRunnableImpl();
		return dSmodelRunnable;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public GenericRunnable createGenericRunnable() {
		GenericRunnableImpl genericRunnable = new GenericRunnableImpl();
		return genericRunnable;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public EventRunnablePort createEventRunnablePort() {
		EventRunnablePortImpl eventRunnablePort = new EventRunnablePortImpl();
		return eventRunnablePort;
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @generated
	 */
	public RTOSPackage getRTOSPackage() {
		return (RTOSPackage)getEPackage();
	}

	/**
	 * <!-- begin-user-doc -->
	 * <!-- end-user-doc -->
	 * @deprecated
	 * @generated
	 */
	@Deprecated
	public static RTOSPackage getPackage() {
		return RTOSPackage.eINSTANCE;
	}

} //RTOSFactoryImpl
